<!doctype html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="generator" content="Docusaurus v2.0.0-alpha.72">
<link rel="alternate" type="application/rss+xml" href="/zh-cn.neutralinojs.github.io/blog/rss.xml" title="Neutralinojs Blog RSS Feed">
<link rel="alternate" type="application/atom+xml" href="/zh-cn.neutralinojs.github.io/blog/atom.xml" title="Neutralinojs Blog Atom Feed">
<link rel="preconnect" href="https://www.google-analytics.com">
<link rel="preconnect" href="https://www.googletagmanager.com">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-120983955-1"></script>
<script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","UA-120983955-1",{anonymize_ip:!0})</script>
<script src="https://media.ethicalads.io/media/client/ethicalads.min.js"></script>
<script src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js" async></script><title data-react-helmet="true">框架开发指南 | Neutralinojs</title><meta data-react-helmet="true" property="og:url" content="https://wll8.gitee.io/zh-cn.neutralinojs.github.io/zh-cn.neutralinojs.github.io/docs/contributing/framework-developer-guide"><meta data-react-helmet="true" name="docusaurus_locale" content="en"><meta data-react-helmet="true" name="docusaurus_version" content="current"><meta data-react-helmet="true" name="docusaurus_tag" content="docs-default-current"><meta data-react-helmet="true" property="og:title" content="框架开发指南 | Neutralinojs"><meta data-react-helmet="true" name="description" content="优秀的开源软件是热情的开发者合作的结果。任何人都可以通过贡献代码和报告错误来帮助Neutralino。本文档解释了如何开始为Neutralinojs做贡献。"><meta data-react-helmet="true" property="og:description" content="优秀的开源软件是热情的开发者合作的结果。任何人都可以通过贡献代码和报告错误来帮助Neutralino。本文档解释了如何开始为Neutralinojs做贡献。"><link data-react-helmet="true" rel="shortcut icon" href="/zh-cn.neutralinojs.github.io/img/favicon.png"><link data-react-helmet="true" rel="canonical" href="https://wll8.gitee.io/zh-cn.neutralinojs.github.io/zh-cn.neutralinojs.github.io/docs/contributing/framework-developer-guide"><link data-react-helmet="true" rel="alternate" href="https://wll8.gitee.io/zh-cn.neutralinojs.github.io/zh-cn.neutralinojs.github.io/docs/contributing/framework-developer-guide" hreflang="en"><link data-react-helmet="true" rel="alternate" href="https://wll8.gitee.io/zh-cn.neutralinojs.github.io/zh-cn.neutralinojs.github.io/docs/contributing/framework-developer-guide" hreflang="x-default"><link rel="stylesheet" href="/zh-cn.neutralinojs.github.io/assets/css/styles.b7ecac1c.css">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/styles.c25d7c9f.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/runtime~main.da1bdab8.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/main.22927eab.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/1.a80d899d.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/2.818fc9a7.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/49.8e895b96.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/50.816652b0.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/935f2afb.a67ede05.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/17896441.74f92a0c.js" as="script">
<link rel="preload" href="/zh-cn.neutralinojs.github.io/assets/js/4ca08687.2568cebe.js" as="script">
</head>
<body>
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}()</script><div id="__docusaurus">
<div><a href="#main" class="skipToContent_1oUP">Skip to main content</a></div><nav class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Navigation bar toggle" class="navbar__toggle" type="button" tabindex="0"><svg aria-label="Menu" width="30" height="30" viewBox="0 0 30 30" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/zh-cn.neutralinojs.github.io/"><img src="/zh-cn.neutralinojs.github.io/img/logo.png" alt="Neutralinojs Logo" class="themedImage_1VuW themedImage--light_3UqQ navbar__logo"><img src="/zh-cn.neutralinojs.github.io/img/logo.png" alt="Neutralinojs Logo" class="themedImage_1VuW themedImage--dark_hz6m navbar__logo"><strong class="navbar__title">Neutralinojs</strong></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/zh-cn.neutralinojs.github.io/docs/">文档</a><a class="navbar__item navbar__link" href="/zh-cn.neutralinojs.github.io/apps/">应用</a><a class="navbar__item navbar__link" href="/zh-cn.neutralinojs.github.io/resources/">资源</a><a href="https://www.youtube.com/c/CodeZri" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">视频</a><a href="https://codezri.org/blog/neutralinojs-2024-roadmap" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">路线图</a><a class="navbar__item navbar__link" href="/zh-cn.neutralinojs.github.io/docs/release-notes/framework">发布说明</a><a href="https://github.com/neutralinojs/gsoc2024" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GSoC 2024</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/neutralinojs" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GitHub</a><a href="https://www.patreon.com/shalithasuranga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">❤️ 捐赠</a><div class="react-toggle react-toggle--disabled displayOnlyInLargeViewport_GrZ2"><div class="react-toggle-track"><div class="react-toggle-track-check"><span class="toggle_71bT">🌜</span></div><div class="react-toggle-track-x"><span class="toggle_71bT">🌞</span></div></div><div class="react-toggle-thumb"></div><input type="checkbox" disabled="" aria-label="Dark mode toggle" class="react-toggle-screenreader-only"></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div><div class="navbar-sidebar"><div class="navbar-sidebar__brand"><a class="navbar__brand" href="/zh-cn.neutralinojs.github.io/"><img src="/zh-cn.neutralinojs.github.io/img/logo.png" alt="Neutralinojs Logo" class="themedImage_1VuW themedImage--light_3UqQ navbar__logo"><img src="/zh-cn.neutralinojs.github.io/img/logo.png" alt="Neutralinojs Logo" class="themedImage_1VuW themedImage--dark_hz6m navbar__logo"><strong class="navbar__title">Neutralinojs</strong></a></div><div class="navbar-sidebar__items"><div class="menu"><ul class="menu__list"><li class="menu__list-item"><a aria-current="page" class="menu__link navbar__link--active" href="/zh-cn.neutralinojs.github.io/docs/">文档</a></li><li class="menu__list-item"><a class="menu__link" href="/zh-cn.neutralinojs.github.io/apps/">应用</a></li><li class="menu__list-item"><a class="menu__link" href="/zh-cn.neutralinojs.github.io/resources/">资源</a></li><li class="menu__list-item"><a href="https://www.youtube.com/c/CodeZri" target="_blank" rel="noopener noreferrer" class="menu__link">视频</a></li><li class="menu__list-item"><a href="https://codezri.org/blog/neutralinojs-2024-roadmap" target="_blank" rel="noopener noreferrer" class="menu__link">路线图</a></li><li class="menu__list-item"><a class="menu__link" href="/zh-cn.neutralinojs.github.io/docs/release-notes/framework">发布说明</a></li><li class="menu__list-item"><a href="https://github.com/neutralinojs/gsoc2024" target="_blank" rel="noopener noreferrer" class="menu__link">GSoC 2024</a></li><li class="menu__list-item"><a href="https://github.com/neutralinojs" target="_blank" rel="noopener noreferrer" class="menu__link">GitHub</a></li><li class="menu__list-item"><a href="https://www.patreon.com/shalithasuranga" target="_blank" rel="noopener noreferrer" class="menu__link">❤️ 捐赠</a></li></ul></div></div></div></nav><div class="main-wrapper main-docs-wrapper"><div class="docPage_31aa"><div class="docSidebarContainer_3Kbt" role="complementary"><div class="sidebar_15mo"><div class="menu menu--responsive thin-scrollbar menu_Bmed"><button aria-label="Open menu" aria-haspopup="true" class="button button--secondary button--sm menu__button" type="button"><svg aria-label="Menu" class="sidebarMenuIcon_fgN0" width="24" height="24" viewBox="0 0 30 30" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><ul class="menu__list"><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">入门指南</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/">简介</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/getting-started/your-first-neutralinojs-app">您的第一个Neutralinojs应用</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/getting-started/using-frontend-libraries">使用前端库</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">原生 API</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/overview">原生API概览</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/app">Neutralino.app</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/clipboard">Neutralino.clipboard</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/computer">Neutralino.computer</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/custom">Neutralino.custom</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/debug">Neutralino.debug</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/events">Neutralino.events</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/extensions">Neutralino.extensions</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/filesystem">Neutralino.filesystem</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/init">Neutralino.init</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/os">Neutralino.os</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/storage">Neutralino.storage</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/updater">Neutralino.updater</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/window">Neutralino.window</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/error-codes">错误码</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/api/global-variables">全局变量</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">CLI</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/cli/neu-cli">neu CLI</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/cli/internal-cli-arguments">Internal 命令行参数</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">配置</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/configuration/neutralino.config.json">neutralino.config.json</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/configuration/project-structure">项目结构</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/configuration/modes">模式</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">如何操作</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/how-to/extensions-overview">扩展概述</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/how-to/auto-updater">自动更新器</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">分发</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/distribution/overview">分发概述</a></li></ul></li><li class="menu__list-item"><a class="menu__link menu__link--sublist menu__link--active" href="#!">贡献</a><ul class="menu__list"><li class="menu__list-item"><a aria-current="page" class="menu__link menu__link--active active" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/contributing/framework-developer-guide">框架开发指南</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/contributing/architecture">架构</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/contributing/security">安全性</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/contributing/code-style-guide">代码风格指南</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/contributing/developer-support">开发者支持</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/contributing/committers">提交者</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/contributing/frequently-asked-questions">常见问题解答</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/zh-cn.neutralinojs.github.io/docs/contributing/about-neutralinojs">关于 Neutralinojs</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">发布说明</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/release-notes/framework">框架</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/release-notes/cli">命令行</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/zh-cn.neutralinojs.github.io/docs/release-notes/client-library">客户端</a></li></ul></li></ul></div></div></div><main class="docMainContainer_3ufF"><div class="container padding-vert--lg docItemWrapper_3FMP"><div class="row"><div class="col docItemCol_2rXS"><div class="docItemContainer_1EXp"><article><header><h1 class="docTitle_1vX4">框架开发指南</h1></header><div class="markdown"><p>优秀的开源软件是热情的开发者合作的结果。任何人都可以通过贡献代码和报告错误来帮助Neutralino。本文档解释了如何开始为Neutralinojs做贡献。</p><p>请注意，这份指南是为框架开发者准备的。如果你刚开始Neutralinojs应用开发，你可以从<a href="/zh-cn.neutralinojs.github.io/docs/getting-started/your-first-neutralinojs-app">这里</a>开始。</p><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="设置和构建框架"></a>设置和构建框架<a class="hash-link" href="#设置和构建框架" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="克隆仓库"></a>克隆仓库<a class="hash-link" href="#克隆仓库" title="Direct link to heading">#</a></h3><p>首先，克隆主仓库。</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly bash"><div tabindex="0" class="prism-code language-bash codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token function" style="color:rgb(130, 170, 255)">git</span><span class="token plain"> clone https://github.com/neutralinojs/neutralinojs.git</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token builtin class-name" style="color:rgb(255, 203, 107)">cd</span><span class="token plain"> neutralinojs</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="安装编译工具和依赖"></a>安装编译工具和依赖<a class="hash-link" href="#安装编译工具和依赖" title="Direct link to heading">#</a></h3><h4><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="linux"></a>Linux<a class="hash-link" href="#linux" title="Direct link to heading">#</a></h4><p>不需要单独的编译器，因为Linux发行版通常已经安装了GNU C/C++编译器。</p><p>使用以下命令安装GTK、WebKit和其他库。</p><h5><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="debian"></a>Debian<a class="hash-link" href="#debian" title="Direct link to heading">#</a></h5><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly bash"><div tabindex="0" class="prism-code language-bash codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token function" style="color:rgb(130, 170, 255)">sudo</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">apt</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">install</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">\</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    libgtk-3-dev </span><span class="token punctuation" style="color:rgb(199, 146, 234)">\</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    libwebkit2gtk-4.0-37 </span><span class="token punctuation" style="color:rgb(199, 146, 234)">\</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    libwebkit2gtk-4.0-dev</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><h5><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="fedora"></a>Fedora<a class="hash-link" href="#fedora" title="Direct link to heading">#</a></h5><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly bash"><div tabindex="0" class="prism-code language-bash codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token function" style="color:rgb(130, 170, 255)">sudo</span><span class="token plain"> dnf </span><span class="token function" style="color:rgb(130, 170, 255)">install</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">\</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    @development-tools </span><span class="token punctuation" style="color:rgb(199, 146, 234)">\</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    gtk3 </span><span class="token punctuation" style="color:rgb(199, 146, 234)">\</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    webkit2gtk3.x86_64 </span><span class="token punctuation" style="color:rgb(199, 146, 234)">\</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    webkit2gtk3-devel.x86_64 </span><span class="token punctuation" style="color:rgb(199, 146, 234)">\</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    libgtk-3-dev </span><span class="token punctuation" style="color:rgb(199, 146, 234)">\</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    libwebkit2gtk-4.0-37 </span><span class="token punctuation" style="color:rgb(199, 146, 234)">\</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    libwebkit2gtk-4.0-dev </span><span class="token punctuation" style="color:rgb(199, 146, 234)">\</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    libglib2.0-dev </span><span class="token punctuation" style="color:rgb(199, 146, 234)">\</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    libxrandr-dev</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><h5><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="arch"></a>Arch<a class="hash-link" href="#arch" title="Direct link to heading">#</a></h5><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly bash"><div tabindex="0" class="prism-code language-bash codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token function" style="color:rgb(130, 170, 255)">sudo</span><span class="token plain"> pacman -S </span><span class="token punctuation" style="color:rgb(199, 146, 234)">\</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    gtk3 </span><span class="token punctuation" style="color:rgb(199, 146, 234)">\</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">    webkit2gtk</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><h4><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="windows"></a>Windows<a class="hash-link" href="#windows" title="Direct link to heading">#</a></h4><p>安装最新的Visual Studio IDE和Windows SDK。Neutralinojs的编译过程将使用MSVC C++编译器（又名<code>cl.exe</code>）。</p><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</h5></div><div class="admonition-content"><p>如何激活Windows 10 SDK：在Visual Studio安装器中安装时，转到工作负载选项卡，&quot;桌面与移动&quot;部分并选择&quot;C++桌面开发&quot;。在右侧的&quot;安装详情&quot; &gt; &quot;C++桌面开发&quot; &gt; &quot;可选&quot;中，确保选中了&quot;Windows 10 SDK&quot;。</p></div></div><h4><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="macos"></a>macOS<a class="hash-link" href="#macos" title="Direct link to heading">#</a></h4><p>安装Xcode命令行工具。</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="编译neutralinojs框架。"></a>编译Neutralinojs框架。<a class="hash-link" href="#编译neutralinojs框架。" title="Direct link to heading">#</a></h3><p>运行以下脚本以构建框架二进制文件。</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly bash"><div tabindex="0" class="prism-code language-bash codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">python scripts/bz.py</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</h5></div><div class="admonition-content"><p>你需要安装<a href="https://www.python.org/downloads/" target="_blank" rel="noopener noreferrer">Python</a>解释器（版本3.x）来运行这个脚本。</p></div></div><p>Neutralinojs使用BuildZri C++构建自动化工具在本地开发计算机和CI/CD服务器上生成二进制文件。阅读<a href="https://codezri.org/docs/buildzri/intro" target="_blank" rel="noopener noreferrer">BuildZri文档</a>了解更多关于CLI选项和配置的信息。</p><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="设置和构建客户端"></a>设置和构建客户端<a class="hash-link" href="#设置和构建客户端" title="Direct link to heading">#</a></h2><p>Neutralinojs应用通过WebSocket连接与Neutralinojs进程通信。这个WebSocket连接由Neutralinojs客户端发起。</p><p>将客户端仓库克隆到你下载主仓库的同一目录下。</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly bash"><div tabindex="0" class="prism-code language-bash codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token function" style="color:rgb(130, 170, 255)">git</span><span class="token plain"> clone https://github.com/neutralinojs/neutralino.js.git</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token builtin class-name" style="color:rgb(255, 203, 107)">cd</span><span class="token plain"> neutralino.js</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><p>安装开发者依赖。</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly bash"><div tabindex="0" class="prism-code language-bash codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token function" style="color:rgb(130, 170, 255)">npm</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">install</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="执行测试应用"></a>执行测试应用<a class="hash-link" href="#执行测试应用" title="Direct link to heading">#</a></h2><p>主仓库有一个简单的测试应用，你可以在开发相关活动中使用。你可以从主仓库输入以下命令来构建和更新测试应用的客户端。</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly bash"><div tabindex="0" class="prism-code language-bash codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token function" style="color:rgb(130, 170, 255)">bash</span><span class="token plain"> ./scripts/update_client.sh</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><p>现在用以下命令运行新编译的测试应用。</p><div class="tabs-container"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_1uMI tabs__item--active">Linux</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_1uMI">macOS</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_1uMI">Windows</li></ul><div class="margin-vert--md"><div role="tabpanel"><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly bash"><div tabindex="0" class="prism-code language-bash codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">./bin/neutralino-linux_x64 --load-dir-res</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div></div><div role="tabpanel" hidden=""><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly bash"><div tabindex="0" class="prism-code language-bash codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"># 对于Intel处理器（x64）</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">./bin/neutralino-mac_x64 --load-dir-res</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block">
</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"># 对于新款苹果处理器（arm64）</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">./bin/neutralino-mac_arm64 --load-dir-res</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div></div><div role="tabpanel" hidden=""><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly bash"><div tabindex="0" class="prism-code language-bash codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token plain">./bin/neutralino-win_x64.exe --load-dir-res</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div></div></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="测试"></a>测试<a class="hash-link" href="#测试" title="Direct link to heading">#</a></h2><p>测试是每项开发活动中至关重要的部分。主代码库中的每个拉取请求都将触发以下自动化测试。</p><ul><li>在Linux、macOS和Windows上使用x64机器构建。</li><li>集成测试套件。</li></ul><p>然而，你也可以使用主代码库目录中的以下命令在本地计算机上运行我们的集成测试套件。</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly bash"><div tabindex="0" class="prism-code language-bash codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token builtin class-name" style="color:rgb(255, 203, 107)">cd</span><span class="token plain"> spec</span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token function" style="color:rgb(130, 170, 255)">npm</span><span class="token plain"> </span><span class="token function" style="color:rgb(130, 170, 255)">install</span><span class="token plain"></span></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token function" style="color:rgb(130, 170, 255)">npm</span><span class="token plain"> run </span><span class="token builtin class-name" style="color:rgb(255, 203, 107)">test</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><p>使用以下命令为你更新的模块运行测试套件总是很好的。</p><div class="codeBlockContainer_K1bP"><div class="codeBlockContent_hGly bash"><div tabindex="0" class="prism-code language-bash codeBlock_23N8 thin-scrollbar"><div class="codeBlockLines_39YC" style="color:#bfc7d5;background-color:#292d3e"><div class="token-line" style="color:#bfc7d5"><span class="token function" style="color:rgb(130, 170, 255)">npm</span><span class="token plain"> run </span><span class="token builtin class-name" style="color:rgb(255, 203, 107)">test</span><span class="token plain"> </span><span class="token operator" style="color:rgb(137, 221, 255)">&lt;</span><span class="token plain">module</span><span class="token operator" style="color:rgb(137, 221, 255)">&gt;</span><span class="token plain"> </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic"># 例如: npm run test filesystem</span></div></div></div><button type="button" aria-label="Copy code to clipboard" class="copyButton_Ue-o">Copy</button></div></div><div class="admonition admonition-info alert alert--info"><div class="admonition-heading"><h5><span class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</h5></div><div class="admonition-content"><p>如果你需要为<code>extensions</code>模块运行测试，请确保首先从<code>./bin/extensions/sampleextension</code>输入<code>npm install</code>。</p></div></div><p>上述命令将只为给定模块运行测试。</p><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="项目目录结构"></a>项目目录结构<a class="hash-link" href="#项目目录结构" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="框架"></a>框架<a class="hash-link" href="#框架" title="Direct link to heading">#</a></h3><p>来源：<a href="https://github.com/neutralinojs/neutralinojs" target="_blank" rel="noopener noreferrer">github.com/neutralinojs/neutralinojs</a></p><ul><li><code>api</code>：本地API实现和控制器。以REST API风格编写。</li><li><code>auth</code>：认证和权限相关逻辑。</li><li><code>bin</code>：测试应用源代码。</li><li><code>lib</code>：第三方库源文件。</li><li><code>server</code>：WebSocket/HTTP通信端点。</li><li><code>spec</code>：集成/API测试套件。</li><li><code>scripts</code>：包含构建框架、生成发布说明、更新客户端库和为测试应用构建<code>resources.neu</code>的自动化脚本。</li></ul><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="客户端库"></a>客户端库<a class="hash-link" href="#客户端库" title="Direct link to heading">#</a></h3><p>来源：<a href="https://github.com/neutralinojs/neutralino.js" target="_blank" rel="noopener noreferrer">github.com/neutralinojs/neutralino.js</a></p><ul><li><code>src/api</code>：JavaScript API前端和实现。</li><li><code>src/browser</code>：与浏览器相关的API实现。</li><li><code>src/ws</code>：WebSocket客户端实现。</li><li><code>scripts</code>：包含生成发布说明的自动化脚本。</li></ul><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_2LWZ" id="贡献指南"></a>贡献指南<a class="hash-link" href="#贡献指南" title="Direct link to heading">#</a></h2><p>在向代码库贡献之前，请检查以下事项。</p><ul><li>通过GitHub讨论与Neutralinojs团队讨论特性/改进/错误修复。</li><li>熟悉代码风格。根据<a href="/zh-cn.neutralinojs.github.io/docs/contributing/code-style-guide">Neutralinojs代码风格指南</a>编写你的代码。</li><li>熟悉代码库中的所有模块。</li><li>避免只为一个平台添加新功能。</li></ul><p>感谢你帮助我们使Neutralinojs变得更好！</p></div></article><div class="margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/neutralinojs/neutralinojs.github.io/edit/main/docs/contributing/framework-developer-guide.mdx" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" role="img" viewBox="0 0 40 40" class="iconEdit_2_ui" aria-label="Edit page"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav" aria-label="Docs pages navigation"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/zh-cn.neutralinojs.github.io/docs/distribution/overview"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">« 分发概述</div></a></div><div class="pagination-nav__item pagination-nav__item--next"><a class="pagination-nav__link" href="/zh-cn.neutralinojs.github.io/docs/contributing/architecture"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">架构 »</div></a></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_1nbE thin-scrollbar"><div><div data-ea-publisher="neutralino" data-ea-type="image" id="neutralino-docs"></div></div><ul class="table-of-contents table-of-contents__left-border"><li><a href="#设置和构建框架" class="table-of-contents__link">设置和构建框架</a><ul><li><a href="#克隆仓库" class="table-of-contents__link">克隆仓库</a></li><li><a href="#安装编译工具和依赖" class="table-of-contents__link">安装编译工具和依赖</a></li><li><a href="#编译neutralinojs框架。" class="table-of-contents__link">编译Neutralinojs框架。</a></li></ul></li><li><a href="#设置和构建客户端" class="table-of-contents__link">设置和构建客户端</a></li><li><a href="#执行测试应用" class="table-of-contents__link">执行测试应用</a></li><li><a href="#测试" class="table-of-contents__link">测试</a></li><li><a href="#项目目录结构" class="table-of-contents__link">项目目录结构</a><ul><li><a href="#框架" class="table-of-contents__link">框架</a></li><li><a href="#客户端库" class="table-of-contents__link">客户端库</a></li></ul></li><li><a href="#贡献指南" class="table-of-contents__link">贡献指南</a></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="row footer__links"><div class="col footer__col"><h4 class="footer__title">文档</h4><ul class="footer__items"><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/docs/">入门</a></li><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/docs/api/overview">API参考</a></li><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/docs/cli/neu-cli">CLI</a></li><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/docs/configuration/modes">模式</a></li><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/docs/contributing/framework-developer-guide">贡献</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">社区</h4><ul class="footer__items"><li class="footer__item"><a href="https://github.com/neutralinojs" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub</a></li><li class="footer__item"><a href="https://twitter.com/neutralinojs" target="_blank" rel="noopener noreferrer" class="footer__link-item">Twitter</a></li><li class="footer__item"><a href="https://stackoverflow.com/questions/tagged/neutralinojs" target="_blank" rel="noopener noreferrer" class="footer__link-item">Stack Overflow</a></li><li class="footer__item"><a href="https://medium.com/neutralinojs" target="_blank" rel="noopener noreferrer" class="footer__link-item">Medium</a></li><li class="footer__item"><a href="https://www.youtube.com/watch?v=txDlNNsgSh8&amp;list=PLvTbqpiPhQRb2xNQlwMs0uVV0IN8N-pKj&amp;ab_channel=CodeZri" target="_blank" rel="noopener noreferrer" class="footer__link-item">YouTube</a></li><li class="footer__item"><a href="https://join.slack.com/t/neutralinojs/shared_invite/zt-b7mbivj5-pKpO6U5drmeT68vKD_pc6w" target="_blank" rel="noopener noreferrer" class="footer__link-item">Slack</a></li><li class="footer__item"><a href="https://discord.gg/cybpp4guTJ" target="_blank" rel="noopener noreferrer" class="footer__link-item">Discord</a></li><li class="footer__item"><a href="https://www.reddit.com/r/neutralinojs/" target="_blank" rel="noopener noreferrer" class="footer__link-item">Reddit</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">更多</h4><ul class="footer__items"><li class="footer__item"><a href="https://github.com/neutralinojs/neutralinojs" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub</a></li><li class="footer__item"><a href="https://www.patreon.com/shalithasuranga" target="_blank" rel="noopener noreferrer" class="footer__link-item">Patreon</a></li><li class="footer__item"><a class="footer__link-item" href="/zh-cn.neutralinojs.github.io/privacy-policy">隐私政策</a></li><li class="footer__item"><a href="https://codezri.org/blog/" target="_blank" rel="noopener noreferrer" class="footer__link-item">博客</a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">Copyright © 2024 Neutralinojs | innovation by <a href="https://codezri.org/">CodeZri.org</a></div></div></div></footer></div>
<script src="/zh-cn.neutralinojs.github.io/assets/js/styles.c25d7c9f.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/runtime~main.da1bdab8.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/main.22927eab.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/1.a80d899d.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/2.818fc9a7.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/49.8e895b96.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/50.816652b0.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/935f2afb.a67ede05.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/17896441.74f92a0c.js"></script>
<script src="/zh-cn.neutralinojs.github.io/assets/js/4ca08687.2568cebe.js"></script>
</body>
</html>